<?php
/**
 * @version		$Id: view.html.php 17130 2010-05-17 05:52:36Z eddieajau $
 * @copyright	Copyright (C) 2005 - 2010 Open Source Matters, Inc. All rights reserved.
 * @license		GNU General Public License version 2 or later; see LICENSE.txt
 */

// No direct access
defined('_JEXEC') or die;

jimport('joomla.application.component.view');

/**
 * @package		Joomla.Administrator
 * @subpackage	com_content
 */
class AjaxWhoisViewConfigs extends JView
{
	protected $items;
	protected $pagination;
	protected $state;

	/**
	 * Display the view
	 */
	public function display($tpl = null)
	{
		$this->items		= $this->get('Items');
		$this->pagination	= $this->get('Pagination');
		$this->state		= $this->get('State');

		// Check for errors.
		if (count($errors = $this->get('Errors'))) {
			JError::raiseError(500, implode("\n", $errors));
			return false;
		}

		$this->addToolbar();
		parent::display($tpl);
	}
	
	/**
	 * Setting the toolbar
	 */
	protected function addToolBar() {
		
		$state	= $this->get('State');
		
		JToolBarHelper::title(JText::_('com_ajaxwhois_Config_Manager'), 'configs');
		JToolBarHelper::makeDefault('configs.setDefault', 'COM_AJAXWHOIS_TOOLBAR_SET_HOME');
		JToolBarHelper::addNew('configs.duplicate', 'JTOOLBAR_DUPLICATE');
		JToolBarHelper::divider();
		JToolBarHelper::addNewX('config.add');
		JToolBarHelper::editListX('config.edit');
		JToolBarHelper::deleteListX('com_ajaxwhois_Configs_Are_you_sure_you_want_to_delete_these_configs', 'configs.remove');

	}
}
